import {SlashAppContext} from "slash-admin";
import {routesArray} from "@/router";

export * from "@/views"
export const SlashAuthAppPlugin = {
    async install(appContext: SlashAppContext, options: any) {
        console.log("安装授权服务应用")
        await appContext.addRouters(routesArray);
        appContext.addAvatarOptions({
            key: 'personal-center',
            label: '个人中心',
            onSelect: () => {
                appContext.getRouter()?.push({
                    path: `/AuthApp/PersonalCenterEntry`,
                    query: {
                        slashInnerTitle: '个人中心',
                        slashInnerOpen: 1
                    }
                })
            }
        })
    },
};
export const appSetup = async () => {
    if (window['appContext']) {
        await SlashAuthAppPlugin.install(window['appContext'], {});
    }
}
appSetup();
